package com.dailyblue.java.spring.ssm.controller;

import com.alibaba.fastjson.JSONArray;
import com.dailyblue.java.spring.ssm.service.EmpService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/emp")
public class EmpController {
    @Resource
    private EmpService empService;

    @GetMapping(value = "/find", produces = {"application/json;charset=utf-8"})
    public String find() {
        return JSONArray.toJSONString(empService.findAllEmp());
    }
}
